define(['jquery', 'bootstrap', 'frontend', 'form', 'template','table','backend'], function ($, undefined, Frontend, Form, Template,Table,Backend,undefined) {

    var Controller = {

        son:function () {

            $('.btn-delone').click(function () {
                var _ids = $(this).data('id');
                //
                layer.confirm('确定是否删除？', {
                    btn: ['取消','确定'] //按钮
                }, function(){
                    layer.msg('取消操作');
                }, function(){
                    $.post("/index/son/status",{ids:_ids},function (data) {
                        location.reload()
                    },'json');
                });
            })


/*
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: '/index/son/son',
                    add_url: 'user/user/add',
                    edit_url: '/index/son/edit',
                    // del_url: 'user/user/del',
                    // multi_url: 'user/user/multi',
                    table: 'user',
                },
                search:false,

            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                columns: [
                    [
                        // {checkbox: true},
                        {field: 'id', title: '账户ID', sortable: true},
                        {field: 'username', title: __('Username'), operate: 'LIKE'},
                        {field: 'mobile', title: '手机', operate: 'LIKE'},
                        {field: 'logintime', title: '登录时间', formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                        {field: 'loginip', title: '登录IP', formatter: Table.api.formatter.search},
                        {field: 'status', title: __('Status'), visible: false,formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
                            buttons:[
                                {
                                    name:'del_score',title:'删除',icon:'fa fa-times',classname: 'btn btn-xs btn-success btn-magic btn-ajax',url:'user/user/status',
                                    success: function (data, ret) {
                                        if ( ret.code == 1){
                                            $("#table").bootstrapTable('refresh');
                                        }else{

                                        }
                                    }
                                }
                            ],
                            formatter: Table.api.formatter.operate
                        }

                    ]
                ]
            });

            // 为表格绑定事件
            // Controller.api.bindevent();
            Table.api.bindevent(table);*/
        }
    };
    return Controller;
});